<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>向商家付款</title>
		<meta content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<link rel="stylesheet" href="../css/common.css">
		<link rel="stylesheet" href="../css/page.css">
		<script src="../js/jquery-3.2.1.min.js"></script>
		<script src="../js/media.js"></script>
		<script src="../js/common.js"></script>
		<script src="../js/public.js"></script>
		<style type="text/css">
			.warn{
				color: red;
				width: 90%;
				margin: 0.36rem auto 0;
			}
			.pay_bth{
				width: 100%;
				height: 0.42rem;
				text-align:center;
				line-height:0.42rem;
				background:#5F3104;
				position:fixed;
				bottom: 0;
				left: 0;
				color: white;
			}
			.kong{
				width: 100%;
				height:0.36rem;
			}
			#input_div{
				width: 90%;
				height: 0.36rem;
				margin: 0.36rem auto 0;
				border-bottom: 0.01rem solid #CCC;
				position: relative;
			}
			input{
				width: 100%;
				line-height: 0.36rem;
				font-size: 0.14rem;
				outline: none;
				border: 0;
				box-sizing: border-box;
				padding-left:0.42rem;
			}
			#input_div img{
				position: absolute;
				width: 0.25rem;
				height: 0.25rem;
				left: 0.05rem;
				top: 0.06rem;
			}
		</style>
	</head>
	<body>
		<div id="input_div">
			<img src="../img/jinee.png"/>
			<input type="text" placeholder="请输入产品价格(不能小于1元)" onkeyup="value=value.replace(/[^(\d|\.)]/g,'');this.value=/^\d+\.?\d{0,2}$/.test(this.value)?this.value: this.value.split('.')[1].length==2?this.value:this.value=this.value.split('.')[0]+'.'+this.value.split('.')[1].substr(0,2);"/>
		</div>
		<p class="warn">注意：本次付款金额，直接回打到卖家的微信账户中，无法退回，请谨慎操作。</p>
		<div class="kong"></div>
		<div class="pay_bth">确认支付</div>
	</body>
	<script type="text/javascript">
	var storeId = GetQueryString("storeId");//付款的店铺id，而不是微信登录人的店铺id
		$('.pay_bth').click(function(){
			var input_val = $('input').val();
			usrpay(input_val);
		});
		function usrpay (val){
			val = Number(val);
			if(val==null||val == ''){
				alert('请输入金额');
			}else if(val <= 1){
				alert('请输入正确的金额');
			}else{
				window.location.href = "./userPay.html"+"?orderType=9"+"&storeId="+storeId+"&price="+val;
			}
		}
	</script>
</html>
